GBML manual / 3D

view3d_hit_wall

The number of the wall picture the last view3d_ray met (0 is the first picture).

Game Boy: not available

Game Boy Color: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

view3d_hit_wall() -> int

Returns

int

Description

The number of the wall picture the last view3d_ray met: 0 is the first picture of the wall sheet, 1 the second, and so on. The room's edge answers 0. It keeps the answer until the next ray.

Example

var d = view3d_ray(view3d_angle());
if (view3d_hit_wall() == 2) { var on_blue = 1; }

Notes that the ray met the third wall picture.

On the GBA

It keeps the answer of the last view3d_ray until the next one. The edge of the room answers 0.

See also: Collision in 3DMaking 3D wallsview3d_rayview3d_hit_x